All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface sun.server.util.URLContents

public interface URLContents
This represents the interface to one disk cache entry in the DiskCache object. A list of such entries form the disk cache.


Method Index

 o available()
Check if the contents in this URLContents is ready for reading or is in the process of being fetched.
 o cacheable()
Are these contents cacheable?
 o cacheHit()
This indicates that the URLContents is being accessed.
 o getContentLength()
The content length of the data on the input stream.
 o getContents()
This is the input stream from which the contents of the URL to be stored or the URL being retrieved is read.
 o getContentType()
The mime type of the contents that is referred to by the URL.
 o getHeaders()
return all the HTTP headers in a hash table format.
 o getLastModifiedDate()
The last modified date on the URL.
 o getResponseCode()
The status code returned from reading the URL.
 o getResponseMessage()
The status message returned from reading the URL.
 o getURL()
The URL that identifies these contents.
 o lastAccessTime()
This is the time of last access on this URL.
 o numHits()
when the URL is being read from the cache, this represents the number of times the URL has been read since being stored in the cache.
 o setCacheable(boolean)
set whether the contents can be cached.
 o setHeaders(Hashtable)
Set the header table.
 o setResponseCode(int)
set the response status.
 o setResponseMessage(String)
set the response message.

Methods

 o getURL
 public abstract URL getURL()
The URL that identifies these contents.

 o getContents
 public abstract InputStream getContents() throws IOException
This is the input stream from which the contents of the URL to be stored or the URL being retrieved is read.

Returns:
the input stream from which contents of the URL is read
 o getContentLength
 public abstract int getContentLength()
The content length of the data on the input stream. If a -1 is returned, the length is until EOF is read on the input stream.

 o getContentType
 public abstract String getContentType()
The mime type of the contents that is referred to by the URL.

 o getLastModifiedDate
 public abstract long getLastModifiedDate()
The last modified date on the URL. The date is represented as the number of miliseconds since Jan 1, 1970.

 o setResponseCode
 public abstract void setResponseCode(int status)
set the response status.

 o setResponseMessage
 public abstract void setResponseMessage(String msg)
set the response message.

 o getResponseCode
 public abstract int getResponseCode()
The status code returned from reading the URL. Returns 200 - which is HTTP succcess by default.

 o getResponseMessage
 public abstract String getResponseMessage()
The status message returned from reading the URL. Returns "OK" - which is HTTP succcess by default.

 o cacheable
 public abstract boolean cacheable()
Are these contents cacheable?

 o setCacheable
 public abstract void setCacheable(boolean b)
set whether the contents can be cached.

 o setHeaders
 public abstract void setHeaders(Hashtable h)
Set the header table. The key is the header name, the value is the header value. Stored under a special key "Status:" is the status line.

 o getHeaders
 public abstract Hashtable getHeaders()
return all the HTTP headers in a hash table format. The key is the header name, the value is the header value. Stored under a special key "Status:" is the status line.

 o numHits
 public abstract int numHits()
when the URL is being read from the cache, this represents the number of times the URL has been read since being stored in the cache.

 o lastAccessTime
 public abstract long lastAccessTime()
This is the time of last access on this URL. It is represented in seconds since Jan 1, 1970.

 o cacheHit
 public abstract void cacheHit()
This indicates that the URLContents is being accessed. When the URLContents object is cached, whenever the object is referred to from the application, this method must be called, so that the last accessed time and the number of hits can be updated.

 o available
 public abstract boolean available()
Check if the contents in this URLContents is ready for reading or is in the process of being fetched.

Returns:
true if the data is ready for reading false if the date is not ready for reading

All Packages  Class Hierarchy  This Package  Previous  Next  Index